const baseWebpackPlugin = require('./webpack.common')
const { merge } = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
/** 
 * @type { import('webpack'.Configuration) }
 */
module.exports = merge(baseWebpackPlugin, {
  devServer: {
    contentBase: path.join(__dirname, 'dist'),
    port: '8080',
    host: 'localhost',
    hot: true,
    // eslint报错输出到浏览器
    overlay: {
      warnings: true,
      errors: true
    }
  },
  module: {
    rules: [
      {
        test: /\.(js|vue)$/,
        exclude: /node_modules/,
        use: 'eslint-loader'
      }
    ]
  },
  devtool: 'cheap-eval-module-source-map'
})